home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 15
/
CU Amiga Magazine's Super CD-ROM 15 (1997)(EMAP Images)(GB)[!][issue 1997-10].iso
/
CUCD
/
Graphics
/
MysticView
/
source
/
global.c
next >
Wrap
C/C++ Source or Header
|
1996-12-28
|
3KB
|
119 lines
/*********************************************************************
----------------------------------------------------------------------
MysticView Global Data
------------------------------------------------------ tabsize = 4 ---
*********************************************************************/
#include <string.h>
#include <exec/memory.h>
#include <proto/exec.h>
#include <proto/render.h>
#include <render/render.h>
#include "global.h"
/*------------------------------------------------------------------*/
static char versionstring[] = "$VER: " PROGNAME;
/*------------------------------------------------------------------*/
APTR memhandler;
struct Library *RenderBase;
struct Library *DataTypesBase;
/*********************************************************************
----------------------------------------------------------------------
BOOL InitGlobal(void)
----------------------------------------------------------------------
*********************************************************************/
BOOL InitGlobal(void)
{
/*
* open render.library
*/
if(RenderBase = OpenLibrary("render.library", RENDER_VERSION))
{
if(DataTypesBase = OpenLibrary("datatypes.library", 39L))
{
/*
* create a global memory handler with render.library
*/
if(memhandler = CreateRMHandler(RND_MemType, RMHTYPE_POOL, TAG_DONE))
{
return TRUE;
}
}
}
return FALSE;
}
/*********************************************************************
----------------------------------------------------------------------
void CloseGlobal(void)
----------------------------------------------------------------------
*********************************************************************/
void CloseGlobal(void)
{
if (memhandler)
{
DeleteRMHandler(memhandler);
}
if (DataTypesBase)
{
CloseLibrary(DataTypesBase);
}
if (RenderBase)
{
CloseLibrary(RenderBase);
}
}
/*********************************************************************
----------------------------------------------------------------------
mem = AllocVecPooled(size)
----------------------------------------------------------------------
*********************************************************************/
APTR AllocVecPooled( ULONG allocsize )
{
return AllocRenderVec( memhandler, allocsize );
}
/*********************************************************************
----------------------------------------------------------------------
FreeVecPooled(mem)
----------------------------------------------------------------------
*********************************************************************/
void FreeVecPooled( APTR memblock )
{
FreeRenderVec( memblock );
}